package com.shaoyu.spring.study.dto;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @author : Swicky
 * @date : 2021/7/9 - 1:23 下午
 */
public class ExcelRequest implements Serializable {

    private List<ExcelSheetRequest> excelSheetRequests;
    private ExcelRequest(){}

    public static ExcelRequest ofSingle(String sheetName,List excelData){
        return new ExcelRequest().setExcelSheetRequests(Collections.singletonList(ExcelSheetRequest.of(sheetName, excelData)));
    }

    public static ExcelRequest of(List<ExcelSheetRequest> excelSheetRequests){
        return new ExcelRequest().setExcelSheetRequests(excelSheetRequests);
    }

    public List<ExcelSheetRequest> getExcelSheetRequests() {
        return excelSheetRequests;
    }

    public ExcelRequest setExcelSheetRequests(List<ExcelSheetRequest> excelSheetRequests) {
        this.excelSheetRequests = excelSheetRequests;
        return this;
    }
}
